/**
 * highlight
 */
import hljs from 'highlight.js';

const beforeMount = (el: any, binding: any) => {
  const codeNodes = el.querySelectorAll('code');
  for (let i = 0; i < codeNodes.length; i++) {
    const codeNode = codeNodes[i];

    if (typeof binding.value === 'string') {
      codeNode.textContent = binding.value;
    }

    hljs.highlightBlock(codeNode);
  }
}
export default { beforeMount }
